<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body>
        <div id="main" style="height: 600px; width: 600px"></div>
    </body>
    <script type="module">
        import * as echarts from "https://cdn.jsdelivr.net/npm/echarts@5.2.2/dist/echarts.esm.min.js";
        import PRD from "../dist/PRD.js";
        var chartDom = document.getElementById("main");
        var myChart = echarts.init(chartDom);
        var option;
        const ctr = new PRD({
            rate: 0.3,
        });
        const x = [...Array(30).keys()].map((i) => i);
        const y = x.map((i) => ctr.update());
        console.log(y);
        option = {
            xAxis: {
                type: "category",
                data: x,
            },
            yAxis: {
                type: "value",
            },
            series: [
                {
                    data: y,
                    type: "line",
                },
            ],
        };

        option && myChart.setOption(option);
    </script>
</html>
